package com.cjm.one.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cjm.one.common.result.Result;
import com.cjm.one.goods.client.GoodsCollectClient;
import com.cjm.one.goods.client.GoodsSKuClient;
import com.cjm.one.model.goods.entity.GoodsSku;
import com.cjm.one.model.goods.enums.SortStrategyEnum;
import com.cjm.one.model.goods.vo.GoodsSkuVo;
import com.cjm.one.service.GoodsSkuService;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class GoodsSkuServiceImpl implements GoodsSkuService {
    @Resource
    private GoodsCollectClient goodsCollectClient;
    @Resource
    private GoodsSKuClient goodsSKuClient;
    @Override
    public Result<Page<GoodsSku>> pageList(Long current, Long size, Long categoryId, String name, SortStrategyEnum strategyEnum) {
        return goodsSKuClient.pageList(current, size, categoryId, name, strategyEnum);

    }

    @Override
    public Result<Page<GoodsSku>> pageListByCategoryId(Long categoryId, Long current, Long size) {
        return goodsSKuClient.pageListByCategoryId(categoryId, current, size);
    }

    @Override
    public Result<Page<GoodsSkuVo>> pageListByCollection(Long current, Long size) {
        return  goodsCollectClient.getGoodsByCollection(current, size);
    }

    @Override
    public Result<Page<GoodsSku>> pageListByCoupon(Long[] ids) {
        return goodsSKuClient.getSkuCoupon(ids);
    }
}
